package net.csdra.libraryborrowing.service.user;

import net.csdra.libraryborrowing.domain.user.TransferBorrowInfo;
import net.csdra.libraryborrowing.service.book.BookServiceBAT;

import java.nio.file.AccessDeniedException;

/**
 * Created by msf on 2017/10/16.
 */
public interface TransferBorrowInfoService {
    /**
     * 生成转借信息
     * bookCopyId必须属于当前用户
     * 创建TransferBorrowInfo，originUserId为当前用户Id，targetUserId为通过recipientUserName获取的用户Id，state设置为READY
     *
     * @param generateTransferBorrowInfo
     * @return
     */
    public TransferBorrowInfo generateTransferBorrowInfo(GenerateTransferBorrowInfo generateTransferBorrowInfo) throws AccessDeniedException;

    class GenerateTransferBorrowInfo {
        //副本Id
        String bookCopyId;
        //接收转借者用户名
        String recipientUserName;

        public String getBookCopyId() {
            return bookCopyId;
        }

        public void setBookCopyId(String bookCopyId) {
            this.bookCopyId = bookCopyId;
        }

        public String getRecipientUserName() {
            return recipientUserName;
        }

        public void setRecipientUserName(String recipientUserName) {
            this.recipientUserName = recipientUserName;
        }
    }
}
